<?php

include '../sql/conn.php';
if($_REQUEST['field']=="kategori"){
    $rs = mysql_query('select * from kategori_barang order by namaKategoriBarang asc');
}
elseif($_REQUEST['field']=="satuan"){
    $rs = mysql_query('select * from satuan_barang order by namaSatuanBarang asc');
}
elseif($_REQUEST['field']=="supplier"){
    $rs = mysql_query('select * from supplier order by namaSupplier asc');
}
elseif($_REQUEST['field']=="customer"){
    $rs = mysql_query('select * from customer order by namaCustomer asc');
}
$result = array();
while($row = mysql_fetch_object($rs)){
	array_push($result, $row);
}

echo json_encode($result);
?>
